import NodeRSA from 'node-rsa'
import store from '../store'

const rsa = new NodeRSA('-----BEGIN PUBLIC KEY-----' + store.getters.rsaPubKey + '-----END PUBLIC KEY-----')
rsa.setOptions({encryptionScheme: 'pkcs1'})

// 公钥加密
export function rsaEncrypt (content) {
  var encryptContent = rsa.encrypt(content, 'base64')
  return encryptContent
}
